package echo_plugin

import (
	"github.com/labstack/echo/v4"
	"net/http"
)

type paramAdapter struct {
	c echo.Context
}

func (e *paramAdapter) GetStringFromPath(name string) (string, error) {
	return e.c.Param(name), nil
}

func (e *paramAdapter) GetRequest() *http.Request {
	return e.c.Request()
}

func (e *paramAdapter) GetResponseWriter() http.ResponseWriter {
	return e.c.Response().Writer
}

func newParamAdapter(c echo.Context) *paramAdapter {
	return &paramAdapter{c: c}
}
